<div class="layuimini-container">
  <form id="app-form" class="layui-form layuimini-form">
    <div class="layui-card">
      <div class="layui-card-header">用户基本信息</div>
      <div class="layui-card-body">
        <table class="layui-table layui-table-form">
          <colgroup>
            <col width="120">
            <col>
          </colgroup>
          <tbody>
          <tr>
            <td class="layui-table-label">昵称</td>
            <td>{$user.nickname|default='--'}</td>
          </tr>
          <tr>
            <td class="layui-table-label">手机号</td>
            <td>{$user.mobile|default='--'}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>

    <div class="layui-card">
      <div class="layui-card-header">帮扶者信息</div>
      <div class="layui-card-body">
        <table class="layui-table layui-table-form">
          <colgroup>
            <col width="120">
            <col>
          </colgroup>
          <tbody>
          <tr>
            <td class="layui-table-label">姓名</td>
            <td>{$helpInfo.real_name|default='--'}</td>
          </tr>
          <tr>
            <td class="layui-table-label">联系电话</td>
            <td>{$helpInfo.phone|default='--'}</td>
          </tr>
          <tr>
            <td class="layui-table-label">个人简介</td>
            <td>{$helpInfo.introduction|default='--'}</td>
          </tr>
          <tr>
            <td class="layui-table-label">身份证正面</td>
            <td>
              {if $helpInfo.id_card_front}
              <div class="layui-inline">
                <img src="{$helpInfo.id_card_front}" alt="身份证正面" style="width: 200px; height: auto;">
              </div>
              {else}
              <span>--</span>
              {/if}
            </td>
          </tr>
          <tr>
            <td class="layui-table-label">身份证反面</td>
            <td>
              {if $helpInfo.id_card_back}
              <div class="layui-inline">
                <img src="{$helpInfo.id_card_back}" alt="身份证反面" style="width: 200px; height: auto;">
              </div>
              {else}
              <span>--</span>
              {/if}
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>

    <div class="layui-card">
      <div class="layui-card-header">审批信息</div>
      <div class="layui-card-body">
        <div class="layui-form-item">
          <label class="layui-form-label required">审批状态</label>
          <div class="layui-input-block">
            <input type="radio" name="approve_status" value="2" title="审批通过" lay-filter="approve_status">
            <input type="radio" name="approve_status" value="3" title="审批拒绝" lay-filter="approve_status">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">审批备注</label>
          <div class="layui-input-block">
            <textarea name="approve_remark" placeholder="请输入审批备注" class="layui-textarea"></textarea>
          </div>
        </div>
      </div>
    </div>

    <div class="hr-line"></div>
    <div class="layui-form-item text-center">
      <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认审批</button>
      <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"  id="cancel-btn">取消</button>
    </div>
  </form>
</div>
<script>
  layui.use(['form', 'jquery'], function() {
    var $ = layui.jquery;

    // 监听取消按钮点击事件
    $('#cancel-btn').on('click', function() {
      // 获取当前窗口的 index（如果是弹窗）
      var index = parent.layer.getFrameIndex(window.name);

      if (index) {
        // 如果是 iframe 弹窗，则关闭弹窗
        parent.layer.close(index);
      } else {
        // 如果是普通页面，可以选择返回上一页或者跳转到其他页面
        // window.history.back();
        // 或者关闭当前窗口
        window.close();
      }
    });
  });
</script>